home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / daten / ispell / interfaces / shell / spell.rexx < prev    next >
OS/2 REXX Batch file  |  1992-09-27  |  1KB  |  50 lines

  1. /*rx
  2.  *  Spell.rexx --- program to spell check a word using the ISpell server
  3.  *  from CLI.
  4.  *
  5.  *  Copyright © 1989, 1992  Loren J. Rittle
  6.  *  Use as you will, just document your changes and keep my copyright
  7.  *  notice intact.  Feel free to mail enhancements to me.
  8.  *
  9.  *  Loren J. Rittle
  10.  *  rittle@comm.mot.com
  11.  *  Wed May 13 05:36:38 1992
  12.  */
  13.  
  14. options results
  15.  
  16. if left(address(), 4) ~== 'WSH_' then
  17.   address command
  18.  
  19. if words(arg(1)) = 0 then
  20.   do
  21.     say 'Usage: spell word1 word2 ...'
  22.     exit 5
  23.   end
  24.  
  25. if ~show(ports, 'IRexxSpell') then
  26.   do
  27.     'run <nil: >nil: ispell -r >nil: <nil:'
  28.     waitforport 'IRexxSpell'
  29.   end
  30.  
  31. do i = 1 to words(arg(1))
  32.   item = word(arg(1),i)
  33.   address 'IRexxSpell' check item
  34.   r = result
  35.   r1 = substr(r,1,1)
  36.   select
  37.     when r1 = '*' then nop
  38.     when r1 = '+' then nop
  39.     when r1 = '&' then
  40.       if words(r) = 2 then
  41.     say "The word '"||item||"' is not found. Try this word:" substr(r,3)
  42.       else
  43.     say "The word '"||item||"' is not found. Try these words:" substr(r,3)
  44.     when r1 = '#' then say "Nothing even close to '"||item||"' found in dictionary!"
  45.     otherwise say "For the word '"||item||"' I got" r
  46.   end
  47. end
  48.  
  49. exit 0
  50.